package com.atguigu.userprofile.dao;

import com.atguigu.userprofile.bean.TagInfo;
import com.atguigu.userprofile.util.MySQLUtil;

import java.util.List;

public class TagInfoDAO {

    public  static TagInfo getTagInfoByTaskId(String taskId){
        String  tagSQL="select * from  tag_info where tag_task_id ='"+taskId+"'";
        TagInfo tagInfo = MySQLUtil.queryOne(tagSQL, TagInfo.class, true);
        return  tagInfo;
    }


    public static List<TagInfo> getTagInfoListWithOn(){
        String  sql=" select ti.* from tag_info ti join task_info tk on ti.tag_task_id = tk.id " +
                "where  tag_level =3  and tk.task_status='1'   ";
        List<TagInfo> tagInfoList = MySQLUtil.queryList(sql, TagInfo.class, true);
        return  tagInfoList;

    }
}
